package com.bwie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bwie.pojo.Journey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface JourneyMapper extends BaseMapper<Journey> {

    @Select("select j.*,u.username from journey as j left join user as u on j.user_id = u.id")
    List<Journey> journeyList();

    @Select("select j.*,u.username from journey as j left join user as u on j.user_id = u.id where j.id = #{id}")
    Journey echoJourneyList(Integer id);



    @Update("update journey set journey_status = #{journeyStatus} where id =#{id}")
    void updateStatus(Journey journey);


}
